package com.mallcai.bigdata.ladon.dpl.mapper.peekdata;

import com.mallcai.bigdata.ladon.dpl.entity.peekdata.ImportRecord;
import com.mallcai.bigdata.ladon.dpl.mapper.peekdata.provider.ImportRecordSqlProvider;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author feixy
 * @version 1.0
 * @date 2019-07-12 16:31
 */
@Repository
public interface ImportRecordMapper {

    @InsertProvider(type = ImportRecordSqlProvider.class, method = "insert")
    int insert(ImportRecord record);

    @SelectProvider(type = ImportRecordSqlProvider.class, method = "getByParams")
    List<ImportRecord> getByParams(@Param("params")  Map<String, Object> params);

    @Update("update  " + ImportRecordSqlProvider.TB_IMPORT_RECORD + " set status = #{status} , error_info = #{errorInfo} where id = #{id}")
    int updateStatus(@Param("id") Long id, @Param("status") int status, @Param("errorInfo") String errorInfo);
}
